<template>
  <div>
      <template v-for="(item,index) in menuList" >
        <el-submenu :index="item.path" :key="index" v-if="item.children && item.children.length>0 && item.children[0].menuType === 1">
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>{{item.menuName}}</span>
        </template>
        <tree-menu :menuList="item.children"></tree-menu>
      </el-submenu>
      <el-menu-item :index="item.path" v-else-if="item.menuType === 1">
        {{item.menuName}}
      </el-menu-item>
      </template>
  </div>
</template>

<script>
export default {
  name: 'TreeMenu',
  props: {
    menuList: {
      type: Array,
      default: [],
    },
  },
};
</script>

<style>

</style>
